Skip to content

feat(MaintainerCard): apply badge style to contributor and consultant roles#803

Merged
KevinVandy merged 1 commit intoTanStack:mainfrom
sukvvon:feat/contributor-role-badge
Apr 2, 2026
Merged

feat(MaintainerCard): apply badge style to contributor and consultant roles#803
KevinVandy merged 1 commit intoTanStack:mainfrom
sukvvon:feat/contributor-role-badge

Conversation

@sukvvon
Copy link
Copy Markdown
Contributor

@sukvvon sukvvon commented Apr 1, 2026

Summary

  • Apply rounded badge style (bg-gray-500 text-white) to Contributor and Consultant role labels in RoleBadge component
  • Matches the existing non-core Maintainer badge style (bg-blue-500 text-white) with a gray color scheme
image

Test plan

  • Verify Contributor/Consultant badges render as gray rounded badges on maintainer cards
  • Confirm Creator and Maintainer badges remain unchanged

Summary by CodeRabbit

  • Style
    • Updated role badge presentation in maintainer cards with a refined pill-shaped design featuring rounded corners, improved padding, and enhanced visual contrast for better readability and interface consistency.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit 74fb545
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69cd1596a195cd0008fd2cc3
😎 Deploy Preview https://deploy-preview-803--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 30 (🔴 down 20 from production)
Accessibility: 90 (no change from production)
Best Practices: 75 (🔴 down 8 from production)
SEO: 97 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Updated the default RoleBadge component styling in MaintainerCard from plain gray text to a styled pill-shaped badge with rounded corners, gray background, white text, and consistent padding. Control flow and role-specific conditional logic remain unchanged.

Changes

Cohort / File(s) Summary
RoleBadge Styling Update
src/components/MaintainerCard.tsx
Transformed default role badge rendering from plain text span to styled pill badge using inline-flex layout, padding, rounded corners, gray background, and white text.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A badge so plain, now wears a coat,
Rounded corners, gray and gloat,
White text dancing on its face,
Role display with newfound grace! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: applying badge styling to contributor and consultant roles in the MaintainerCard component, which aligns with the changeset that converts default role rendering to a styled pill badge.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/MaintainerCard.tsx (1)

45-49: LGTM! Badge styling applied consistently.

The change successfully applies a pill-shaped badge style to Contributor and Consultant roles, matching the visual pattern of Creator and Maintainer badges while using a distinct gray color scheme. The removal of the dark mode text variant is appropriate since the other role badges also use fixed background colors that work in both themes.

Optional: Verify color contrast for accessibility.

While bg-gray-500 (#6B7280) with text-white should provide adequate contrast (approximately 5.7:1), you may want to verify it meets WCAG AA standards for small text.

🎨 Optional: Verify WCAG contrast

Run the following script to check the color contrast ratio:

#!/bin/bash
# Description: Calculate WCAG contrast ratio for gray-500 background with white text

python3 << 'EOF'
def relative_luminance(rgb):
    """Calculate relative luminance for RGB color"""
    rgb_norm = [c / 255.0 for c in rgb]
    rgb_linear = [
        c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
        for c in rgb_norm
    ]
    return 0.2126 * rgb_linear[0] + 0.7152 * rgb_linear[1] + 0.0722 * rgb_linear[2]

def contrast_ratio(rgb1, rgb2):
    """Calculate WCAG contrast ratio between two RGB colors"""
    l1 = relative_luminance(rgb1)
    l2 = relative_luminance(rgb2)
    lighter = max(l1, l2)
    darker = min(l1, l2)
    return (lighter + 0.05) / (darker + 0.05)

# Tailwind gray-500: `#6B7280`, white: `#FFFFFF`
gray_500 = (107, 114, 128)
white = (255, 255, 255)

ratio = contrast_ratio(gray_500, white)
print(f"Contrast ratio: {ratio:.2f}:1")
print(f"WCAG AA (normal text ≥4.5:1): {'✓ Pass' if ratio >= 4.5 else '✗ Fail'}")
print(f"WCAG AA (large text ≥3:1): {'✓ Pass' if ratio >= 3.0 else '✗ Fail'}")
print(f"WCAG AAA (normal text ≥7:1): {'✓ Pass' if ratio >= 7.0 else '✗ Fail'}")
EOF

Expected result: The contrast ratio should be ≥4.5:1 for WCAG AA compliance.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/MaintainerCard.tsx` around lines 45 - 49, The badge styling in
MaintainerCard (the span rendering {role} with className on the <span> in the
MaintainerCard component) is fine, but verify the bg-gray-500/text-white
contrast for small text meets WCAG AA (≥4.5:1) by running the provided contrast
check; if it falls short, update the className used in MaintainerCard (and any
other role badges using bg-gray-500) to a darker gray utility (e.g., bg-gray-600
or bg-gray-700) so the contrast ratio reaches ≥4.5:1, keeping the pill shape and
text-white intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/MaintainerCard.tsx`:
- Around line 45-49: The badge styling in MaintainerCard (the span rendering
{role} with className on the <span> in the MaintainerCard component) is fine,
but verify the bg-gray-500/text-white contrast for small text meets WCAG AA
(≥4.5:1) by running the provided contrast check; if it falls short, update the
className used in MaintainerCard (and any other role badges using bg-gray-500)
to a darker gray utility (e.g., bg-gray-600 or bg-gray-700) so the contrast
ratio reaches ≥4.5:1, keeping the pill shape and text-white intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab7ee7b0-3e09-45dd-9f56-9b8fcb30bdad

📥 Commits

Reviewing files that changed from the base of the PR and between d46c374 and 74fb545.

📒 Files selected for processing (1)
  • src/components/MaintainerCard.tsx

@KevinVandy KevinVandy merged commit 1f56fce into TanStack:main Apr 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants